package org.inspursc.s0517.health.common.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.net.MalformedURLException;
import java.net.URL;

@Controller
public class PageController {
    @ApiOperation(value = "默认登录页面")
    @RequestMapping( value = "/")
    public String index(HttpServletRequest request) throws MalformedURLException {
        if (request.getSession().getAttribute("SPRING_SECURITY_CONTEXT") != null) {
            return "/index";
        } else {
            return "/login";
        }
    }

    @ApiOperation(value = "查看分享评估结果")
    @RequestMapping( value = "/share")
    public String share (){
        return  "/share";
    }
}
